package com.hbsd.paopaobackend.model.enums;

public enum TeamStatusEnum {
    PUBLIC(0, "公开"),
    PRIVATE(1, "私密"),
    SECRET(2, "加密");
    private int value;
    private String text;


    public static TeamStatusEnum getEnumByValue(Integer value) {
        // 如果传来的数据为空，直接返回null
        if (value == null) {
            return null;
        }
        // 遍历枚举类
        TeamStatusEnum[] values = TeamStatusEnum.values();
        for(TeamStatusEnum teamStatusEnum : values) {
            // 找到对应的值
            if(teamStatusEnum.getValue() == value) {
                return teamStatusEnum;
            }
        }
        return null;
    }

    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
